package com.botarena.client.admin;

import com.botarena.client.contest.ContestEditor;
import com.botarena.client.contest.NewContestForm;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class AdminViewer {
	
	public static Panel createAdminPanel() {
		
		VerticalPanel panel = new VerticalPanel();
		panel.setStyleName("contentMain");

		Label title = new Label("Bot Arena administration panel");
		title.setStyleName("title");
		panel.add(title);
		
		Label status = new Label("");
		panel.add(status);
		
		Panel reset = new VerticalPanel();
		reset.setStyleName("contentElementFull");
		
		Label resetDatabase = new Label("Reset database");
		resetDatabase.setStyleName("title2");
		reset.add(resetDatabase);
		
		reset.add(new ResetDatabaseForm(status));
		
		Panel newPanel = new VerticalPanel();
		newPanel.setStyleName("contentElementFull");
		
		Label newContest = new Label("Create new contest");
		newContest.setStyleName("title2");
		newPanel.add(newContest);
		
		newPanel.add(new NewContestForm(status));
		
		Panel edit = new VerticalPanel();
		edit.setStyleName("contentElementFull");
		
		Label showContests = new Label("View existing contests");
		showContests.setStyleName("title2");
		edit.add(showContests);
		
		edit.add(new ContestEditor());
		
		panel.add(reset);
		panel.add(newPanel);
		panel.add(edit);
		
		return panel;
	}
	
}
